//
//  BaseDAO.m
//  express
//
//  Created by dd on 12/15/14.
//  Copyright (c) 2014 yunqi. All rights reserved.
//

#import "BaseDAO.h"
#import "DXKit.h"

@implementation BaseDAO

+ (FMDatabase *)initDB
{
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    NSString *DBPath = [documentsDirectory stringByAppendingPathComponent:@"db.sqlite"];
    [DX i:DBPath];
    
    FMDatabase *db = [FMDatabase databaseWithPath:DBPath];
    if (![db open])
    {
        [DX i:@"open weight db fail"];
        return nil;
    }
    
    return db;
}

+ (void)prepareDB
{
    
}

@end
